<?php $this->load->view('common/head');?>
<?php $this->load->view('common/navbar');?>
<form class="form-inline" method="GET" action="<?php echo $this->input->server('REQUEST_URI'); ?>" name="queryForm" id="queryForm">
<input type="hidden" name="c" id="c" value="<?php echo $this->input->get('c') ?>">
<input type="hidden" name="m" id="m" value="<?php echo $this->input->get('m') ?>">
  <div class="form-group form-group-sm">
    <label for="year">所属年份：</label>
    <select class="form-control" id="year" name="year">
      <option value="">请选择</option>
    </select>
  </div>
  <div class="form-group form-group-sm">
    <label for="timeUnit">所属双月：</label>
    <select class="form-control" id="timeUnit" name="timeUnit">
      <option value="">请选择</option>
	</select>
  </div>
  <div class="form-group form-group-sm">
    <label for="proType">项目类型：</label>
    <select class="form-control" id="proType" name="proType">
      <option value="">请选择</option>
    </select>
  </div>
  <div class="form-group form-group-sm">
    <label for="proStatus">状态：</label>
    <select class="form-control" id="proStatus" name="proStatus">
      <option value="">请选择</option>
    </select>
  </div>
  <div class="form-group form-group-sm">
    <label for="keyword">关键字：</label>
    <input type="text" class="form-control" name="keyword" id="keyword" value="" placeholder="关键字">
  </div>
 <div class="form-group form-group-sm">
  <button type="submit" class="btn btn-primary btn-sm">查询</button>
  </div>
</form>
<div style="text-align: right;">
  <?php if ($this->auth->checkProjectEdit(array('status'=>0))) {?>
  <a class="btnbox btn-info btn-sm" href="<?php echo printUrl('AdminPro', 'add') ?>" role="button">新增执行反馈</a>
  <?php } ?>
</div>
<!-- 表格列表 -->
<div style="margin-top: 10px;">
<table class="table table-bordered table-condensed text-center">
	<thead>
	  <tr class="active">
	    <th class="text-center">所属双月</th>
	    <th class="text-center">项目类型</th>
	    <th class="text-center">项目名称</th>
	    <th class="text-center">状态</th>
	    <th class="text-center">截至提交时间</th>
	    <th class="text-center">已提交</th>
	    <th class="text-center">待审核</th>
	    <th class="text-center">已审核</th>
	    <th class="text-center">操作</th>
	  </tr>
	</thead>
	<tbody>
	  <?php foreach ((array)$proList as $k => $v) {?>
	  <tr align="center">
	    <td><?=$v['timeUnitStr']?></td>
	    <td><?=$v['proTypeName']?></td>
	    <td><a href="<?php echo printUrl('AdminPro','check', array('proId'=>$v['proId'])); ?>"><?=$v['proName']?></a></td>
	    <td><?=$v['proStatusName']?></td>
	    <td><?=date("Y-m-d H:i:s", $v['endTime'])?></td>
      <td><?=$v['storeStatusCount'] ? ($v['storeStatusCount']['auditing']+$v['storeStatusCount']['audited']) : '--'?></td>
      <td><?=$v['storeStatusCount'] ? $v['storeStatusCount']['auditing'] : '--'?></td>
      <td><?=$v['storeStatusCount'] ? $v['storeStatusCount']['audited'] : '--'?></td>
	    <td>
	    	  <?php if ($this->auth->checkStoreProList($v)) {?>
        	<a class="btn btn-info btn-sm" role="button" href="<?php echo printUrl('AdminPro','storeProList', array('proId'=>$v['proId'])); ?>">查看专营店反馈</a>
        	<?php } ?>
	    	  <?php if ($this->auth->checkStoreProReport($v)) {?>
        	<a class="btn btn-info btn-sm" role="button" href="<?php echo printUrl('AdminPro','storeProReport', array('proId'=>$v['proId'])); ?>">查看报告</a>
        	<?php } ?>
          <?php if ($this->auth->checkProjectEditEndTime($v)) {?>
          <a class="btn btn-success btn-sm" role="button" onclick="newWindow('修改结束时间','<?php echo printUrl('AdminPro','editEndTime', array('proId'=>$v['proId'])); ?>', 600, 250)">修改</a>
          <?php } ?>
          <?php if ($this->auth->checkProjectPublish($v)) {?>
          <a class="btn btn-primary btn-sm" role="button" href="<?php echo printUrl('AdminPro','publish', array('proId'=>$v['proId'])); ?>">立即发布</a>
          <?php } ?>
          <?php if ($this->auth->checkProjectEdit($v)) {?>
          <a class="btn btn-success btn-sm" role="button" href="<?php echo printUrl('AdminPro','add', array('proId'=>$v['proId'])); ?>">修改</a>
          <?php } ?>
          <?php if ($this->auth->checkProjectDel($v)) {?>
          <a class="btn btn-danger btn-sm" role="button" onclick="ajaxConfirmSubmit('您确定要删除此反馈项目么?','<?=printUrl('AdminPro','del')?>',{'proId':<?=(int)$v['proId']?>})">删除</a>
          <?php } ?>
	    </td>
	  </tr>
	  <?php } ?>
	</tbody>
</table>
</div>
<!-- 分页 -->
<?=$pager?>
<script type="text/javascript">
  $(function(){
    loadYearList('year',<?=$year ? $year : 0?>);
    loadTimeUnitList('timeUnit',<?=$year ? $year : 0?>,<?=$timeUnit ? $timeUnit : 0?>);
    loadProTypeList('proType', <?=$proType ? $proType : 0?>);
    loadProStatusList('proStatus','<?=isset($_GET['proStatus']) ? $_GET['proStatus']:''?>');
  });
  $("#year").change(function(){
    loadTimeUnitList('timeUnit',this.value);
  });
</script>
<?php $this->load->view('common/foot');?>